

# 把运算符和数字分割开

s = '13+2/2+4*2-2'

def func(s):
    # 专门存放数字
    nums = []
    # 专门存放运算符
    operations = []
    index = 0
    for i in range(len(s)):
        if s[i] in '+-*/':
            operations.append(s[i])
            nums.append(int(s[index:i]))
            index = i+1
    nums.append(int(s[index:]))
    return nums, operations

print(func(s))



